class Task():
    def __init__(self,task) -> None:
        self.task_name = task[0]
        self.task = task[1:]
        self.task_count = len(self.task)
        self.start_time = 0
        self.end_time = 0 
        self.running_task = [] #内部包含多个元组，格式为(任务编号，完成时间，占用资源)，完成时间为系统时间而不是执行时间
        self.finish_task = [0] #已完成的任务
        self.task_done = False
        self.priority = 99

    def fresh(self):
        self.start_time = 0
        self.end_time = 0 
        self.running_task.clear()
        self.finish_task.clear()
        self.finish_task.append(0)
        self.task_done = False
        self.priority = 99

class Tasks():
    def __init__(self,task_list) -> None:
        self.task_list = []
        self.task_count = len(task_list)
        for task in task_list: #将每个任务都转化为Task存入tasks数组
            self.task_list.append(Task(task))

    def fresh(self):
        for task in self.task_list:
            task.fresh()
